﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace Infinity.Expressions.Extension
{
	public static class ExpressionExtension
	{
		public static T CompileExpression<T>(this Expression expression)
		{
			return CompileExpression<T>(expression, null);
		}

		public static T CompileExpression<T>(this Expression expression, params ParameterExpression[] parameters)
		{
			return Expression.Lambda<T>(expression, parameters).Compile();
		}
	}
}
